package decorator.startbuzz;

/**
 * 饮品父类
 *
 * @author jacob
 * @Date 2020/12/5 01:48
 */
public class Beverage {

    /**
     * 饮品描述
     */
    private String description;

    /**
     * 是否添加牛奶
     */
    private boolean milk;

    /**
     * 是否添加豆浆
     */
    private boolean soy;

    /**
     * 是否添加摩卡
     */
    private boolean mocha;

    /**
     * 是否添加奶泡
     */
    private boolean whip;

    /**
     * 初始化四种调料的价格
     */
    private double milkCost;
    private double soyCost;
    private double mochaCost;
    private double whipCost;

    /**
     * 饮品的价格
     *
     * @return
     */
    public double cost() {
        double ret = 0.0;

        if (hasMilk()) {
            ret += milkCost;
        }

        if (hasMocha()) {
            ret += mochaCost;
        }

        if (hasSoy()) {
            ret += soyCost;
        }

        if (hasWhip()) {
            ret += whipCost;
        }

        return ret;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean hasMilk() {
        return milk;
    }

    public void setMilk(boolean milk) {
        this.milk = milk;
    }

    public boolean hasSoy() {
        return soy;
    }

    public void setSoy(boolean soy) {
        this.soy = soy;
    }

    public boolean hasMocha() {
        return mocha;
    }

    public void setMocha(boolean mocha) {
        this.mocha = mocha;
    }

    public boolean hasWhip() {
        return whip;
    }

    public void setWhip(boolean whip) {
        this.whip = whip;
    }

    public double getMilkCost() {
        return milkCost;
    }

    public void setMilkCost(double milkCost) {
        this.milkCost = milkCost;
    }

    public double getSoyCost() {
        return soyCost;
    }

    public void setSoyCost(double soyCost) {
        this.soyCost = soyCost;
    }

    public double getMochaCost() {
        return mochaCost;
    }

    public void setMochaCost(double mochaCost) {
        this.mochaCost = mochaCost;
    }

    public double getWhipCost() {
        return whipCost;
    }

    public void setWhipCost(double whipCost) {
        this.whipCost = whipCost;
    }
}
